import { hasPermission } from '@/directives/permission'
export const TOOL_COLUMN = [
  {
    name: 'ID',
    key: 'id',
    width: 50,
    fixed: 'left'
  },
  {
    name: '所属分类',
    key: 'classifyName',
    slot: 'classifyName'
  },
  {
    name: '工具名称',
    key: 'name',
    align: 'left',
    showOverflowTooltip: true
  },
  {
    name: 'Logo',
    key: 'logo',
    slot: 'logo',
    width: 80
  },
  {
    name: 'URL',
    key: 'url',
    slot: 'url',
    align: 'left',
    width: 260
  },
  {
    name: '描述',
    key: 'description',
    showOverflowTooltip: true
  },
  {
    name: '创建时间',
    key: 'createTime'
  },
  {
    name: '更新时间',
    key: 'updateTime'
  },
  {
    name: '操作',
    key: 'operate',
    fixed: 'right',
    width: 180,
    slot: 'operate',
    hidden: !hasPermission(['tool-list-permission:btn:edit', 'tool-list-permission:btn:delete'])
  }
].filter(o => !o.hidden)

export const TOOL_CLASSIFY_COLUMN = [
  {
    name: 'ID',
    key: 'id',
    width: 80,
    fixed: 'left'
  },
  {
    name: '工具分类名称',
    key: 'name',
    align: 'left',
    showOverflowTooltip: true
  },
  {
    name: '工具数量',
    key: 'toolCount',
    width: 100
  },
  {
    name: 'Icon',
    key: 'icon',
    slot: 'icon',
    width: 80
  },
  {
    name: '创建时间',
    key: 'createTime'
  },
  {
    name: '更新时间',
    key: 'updateTime'
  },
  {
    name: '操作',
    key: 'operate',
    fixed: 'right',
    width: 180,
    slot: 'operate',
    hidden: !hasPermission(['tool-classify-permission:btn:edit', 'tool-classify-permission:btn:delete'])
  }
].filter(o => !o.hidden)
